package com.lanou.bookstore.order.service;

import com.lanou.bookstore.order.dao.OrderDao;
import com.lanou.bookstore.order.dao.OrderDaoImpl;
import com.lanou.bookstore.order.domain.Order;
import com.lanou.bookstore.order.domain.OrderItem;
import com.lanou.bookstore.order.domain.Transit;

import java.util.List;

public class OrderSerciceImpl implements OrderSercice {
    OrderDao ord = new OrderDaoImpl();

    @Override
    // 增加 Order(订单表)
    public void addOrder(Order order) {
        int i = ord.insertOrder(order);
    }

    @Override
    // 增加 OrderItem(订单项表)
    public void addOrderItem(OrderItem item) {
        ord.insertOrderItem(item);
    }

    @Override
    public List<Order> queryAll(String uid) {
        List<Order> orderList = ord.queryAll(uid);
        return orderList;
    }

    @Override
    public List<Transit> queryTransit(String oid) {
        List<Transit> transitList = ord.queryTransit(oid);
        return transitList;
    }

    @Override
    public int queryOid(String oid) {
        int i = ord.queryByOid(oid);
        return i;
    }


}
